package com.ruoyi.member.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.MemberFeedbackMapper;
import com.ruoyi.db.domain.MemberFeedback;
import com.ruoyi.member.service.IMemberFeedbackService;

/**
 * 用户反馈Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-07
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class MemberFeedbackServiceImpl implements IMemberFeedbackService 
{
    @Autowired
    private MemberFeedbackMapper memberFeedbackMapper;

    /**
     * 查询用户反馈
     * 
     * @param id 用户反馈主键
     * @return 用户反馈
     */
    @Override
    public MemberFeedback selectMemberFeedbackById(Long id)
    {
        return memberFeedbackMapper.selectMemberFeedbackById(id);
    }

    /**
     * 查询用户反馈列表
     * 
     * @param memberFeedback 用户反馈
     * @return 用户反馈
     */
    @Override
    public List<MemberFeedback> selectMemberFeedbackList(MemberFeedback memberFeedback)
    {
        return memberFeedbackMapper.selectMemberFeedbackList(memberFeedback);
    }

    /**
     * 查询用户反馈列表
     *
     * @param memberFeedback 用户反馈
     * @return 用户反馈
     */
    @Override
    public List<Map<String, Object>> selectMemberFeedbackMapList(MemberFeedback memberFeedback)
    {
        return memberFeedbackMapper.selectMemberFeedbackMapList(memberFeedback);
    }

    /**
     * 新增用户反馈
     * 
     * @param memberFeedback 用户反馈
     * @return 结果
     */
    @Override
    public int insertMemberFeedback(MemberFeedback memberFeedback)
    {
        memberFeedback.setCreateTime(DateUtils.getNowDate());
        return memberFeedbackMapper.insertMemberFeedback(memberFeedback);
    }

    /**
     * 修改用户反馈
     * 
     * @param memberFeedback 用户反馈
     * @return 结果
     */
    @Override
    public int updateMemberFeedback(MemberFeedback memberFeedback)
    {
        memberFeedback.setUpdateTime(DateUtils.getNowDate());
        return memberFeedbackMapper.updateMemberFeedback(memberFeedback);
    }

    /**
     * 批量删除用户反馈
     * 
     * @param ids 需要删除的用户反馈主键
     * @return 结果
     */
    @Override
    public int deleteMemberFeedbackByIds(Long[] ids)
    {
        return memberFeedbackMapper.deleteMemberFeedbackByIds(ids);
    }

    /**
     * 删除用户反馈信息
     * 
     * @param id 用户反馈主键
     * @return 结果
     */
    @Override
    public int deleteMemberFeedbackById(Long id)
    {
        return memberFeedbackMapper.deleteMemberFeedbackById(id);
    }
}
